<template>
    <div>
        <Dialog v-model="dialogVisible1" :title="state.titleData[props.refuseData.type]" width="420">
            <div class="message_p">
                <el-form :model="state.form" label-width="120px" label-position="top">
                    <el-form-item label="未通过理由">
                        <el-select v-if="props.refuseData.type == 0" v-model="state.form.content" clearable
                            placeholder="请选择未通过理由" style="width: 100%;">
                            <el-option v-for="item in options1" :key="item.dictValue" :label="item.dictLabel"
                                :value="item.dictValue" />
                        </el-select>
                        <el-input class="margin-left16" :autosize="{ minRows: 2}" type="textarea" v-else
                            v-model="state.form.content" placeholder="请输入未通过理由" style="width: 100%;" />
                    </el-form-item>
                    <div class="flex jcfe aic" style="width: 100%;">
                        <el-button @click="DialogClose">取消</el-button>
                        <el-button type="primary" @click="sureClick">确定</el-button>
                    </div>
                </el-form>
            </div>
        </Dialog>
    </div>
</template>
<script lang="ts" setup>
import { dictSect } from "@/utils/dictUnit"
import { ref, reactive } from 'vue'
import { Dialog } from '@/components/Dialog'
import { ElButton } from 'element-plus'
const dialogVisible1 = ref(false)
const loading = ref(false)
const emit = defineEmits(['refuseClick'])
const props = defineProps({
    refuseData: {
        type: Object,
        default: () => {
            return {}
        }
    }

})
const state = reactive({
    form: {
        content: ""
    } as any,
    titleData: ["初筛未通过", "应聘部门未通过", "笔试未通过", "面试未通过", "体检未通过", "面试未通过"]
})
const options1: any = dictSect("resume_label")

const DialogOpen = () => {
    dialogVisible1.value = true
}
const DialogClose = () => {
    dialogVisible1.value = false
}
const sureClick = () => {
    loading.value = true
    let Object = {
        status: true,
        content: state.form.content
    }
    emit('refuseClick', Object)
}
// 暴露方法
defineExpose({
    DialogOpen,
    DialogClose
})
</script>
<style lang="less">
.el-dialog__header {
    padding: 10px;
    border-bottom: 1px solid #D8D8D8;
}

.el-dialog__body {
    padding: 20px;
}
</style>
<style lang="less" scoped>
.message_p {
    padding: 0px 10px 20px 10px;
}

.el-button {
    margin-top: 20px;
    width: 134px;
    height: 40px;
}
</style>